-
Notifications
You must be signed in to change notification settings - Fork 247
test: enable force inclusion, re-enable fi e2e and add fi benchmarks #3005
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
The latest Buf updates on your PR. Results from workflow CI / buf-check (pull_request).
|
Summary of ChangesHello @julienrbrt, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request focuses on enabling and validating the 'force inclusion' functionality within the system. It removes a previous block in the configuration validation that prevented the feature from being active and subsequently re-enables the comprehensive suite of end-to-end tests designed to verify its correct operation across various EVM components. Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
|
Claude finished @julienrbrt's task in 2m 31s —— View job Code Review Complete ✅I've completed a comprehensive code review of the force inclusion feature enablement. Here's my analysis: SummaryThis PR enables the force inclusion feature by:
The changes are straightforward and correctly implement the intended functionality. However, there are several issues that should be addressed before merging. Critical Issues1. Flag Prefix Inconsistency (pkg/config/config.go, test/e2e/evm_force_inclusion_e2e_test.go:352)Issue: The code has inconsistent flag prefixes between Location: test/e2e/evm_force_inclusion_e2e_test.go:352-360 The full node setup uses "--rollkit.da.block_time", DefaultDABlockTime,
"--rollkit.da.address", endpoints.GetDAAddress(),
"--rollkit.da.namespace", DefaultDANamespace,
"--rollkit.da.forced_inclusion_namespace", "forced-inc",
"--rollkit.rpc.address", endpoints.GetFullNodeRPCListen(),
"--rollkit.p2p.listen_address", endpoints.GetFullNodeP2PAddress(),
"--rollkit.p2p.peers", fmt.Sprintf("%s@%s", sequencerID, sequencerP2PAddr),While other tests in the same file and the sequencer setup use Why this matters:
Recommendation: Standardize all flags to use 2. Missing Test Coverage (pkg/config/config.go:295-299)Issue: The re-enabled validation logic for Evidence from Codecov:
Why this matters:
Recommendation: Add unit tests in // Test cases needed:
// 1. Valid forced inclusion namespace → should pass validation
// 2. Invalid namespace format → should return proper error
// 3. Empty namespace when configured → should pass (already handled by len check)Code Quality Observations3. Benchmark Implementation Quality (execution/evm/filter_bench_test.go)Positive aspects:
Minor improvements: a) Benchmark documentation (line 116, 142): // Current:
// BenchmarkFilterTxs_OnlyNormalTxs benchmarks FilterTxs when hasForceIncludedTransaction is false.
// In this case, UnmarshalBinary is NOT called - mempool transactions are already validated.
// Suggested addition:
// Expected: O(n) with minimal allocations, ~100-200 ns/op per transactionb) Helper function safety (line 36-78): // Line 69: Instead of generic error
b.Fatalf("failed to sign transaction: %v", err)
// Consider:
b.Fatalf("failed to sign transaction for nonce %d: %v", nonce, err)c) Test data realism (line 53): // Generate variable-length data to simulate realistic transaction sizes
dataSize := 16 + (i % 100) * 10 // Vary between 16-1016 bytesOverall: The benchmark implementation is production-ready and follows Go best practices. Security Analysis4. Force Inclusion Security PropertiesPositive security aspects:
Security considerations: a) Input validation (pkg/config/config.go:295): if len(c.DA.GetForcedInclusionNamespace()) > 0 {
if err := validateNamespace(c.DA.GetForcedInclusionNamespace()); err != nil {
return fmt.Errorf("could not validate forced inclusion namespace (%s): %w", c.DA.GetForcedInclusionNamespace(), err)
}
}The validation only runs if the namespace is non-empty. This is correct behavior - forced inclusion is optional. However:
b) Malicious sequencer detection (test/e2e/evm_force_inclusion_e2e_test.go:401):
Recommendation: This test MUST be fixed and passing before merge, as it validates a core security property of the system. Performance Considerations5. FilterTxs Performance ImpactThe benchmarks reveal the performance characteristics of enabling force inclusion: Key findings (based on benchmark design):
Performance implications: // BenchmarkFilterTxs_CompareUnmarshalOverhead (line 267-297)
// This benchmark directly measures the overheadExpected overhead from unmarshaling:
Optimization opportunities:
However, these optimizations should be done in follow-up PRs based on actual benchmark results. Testing & Reliability6. E2E Test CoverageRe-enabled tests:
Still disabled: Test quality observations: a) Good practices:
b) Timing assumptions (line 167-172): require.Eventually(t, func() bool {
return evm.CheckTxIncluded(client, txForce.Hash())
}, 30*time.Second, 1*time.Second, "Forced inclusion transaction not included")30-second timeout seems reasonable for
c) Test helper organization: Documentation & Developer Experience7. Documentation QualityConfig documentation (pkg/config/config.go:189): ForcedInclusionNamespace string `mapstructure:"forced_inclusion_namespace" yaml:"forced_inclusion_namespace" comment:"Namespace ID for forced inclusion transactions on the DA layer."`The comment is adequate but could be more informative: // Suggested improvement:
comment:"Namespace ID for forced inclusion transactions on the DA layer. When set, the node will monitor this namespace for transactions that must be included within the epoch window. Leave empty to disable forced inclusion."Test documentation (test/e2e/evm_force_inclusion_e2e_test.go:366-400):
This is exemplary documentation for complex security tests. Architecture & Design8. Configuration ArchitectureThe config changes are minimal and follow existing patterns: Good design aspects:
Design consideration: func (c *Config) validateDAConfig() error { ... }
func (c *Config) validateNodeConfig() error { ... }However, this is a minor refactoring opportunity, not a blocker for this PR. Recommendations SummaryMust Fix Before Merge
Should Fix (High Priority)
Nice to Have (Lower Priority)
Positive Highlights🎉 What's done well:
ConclusionThis PR successfully enables the force inclusion feature with appropriate validation and testing. The implementation is solid, but there are 3 critical items that should be addressed before merge:
The benchmark additions are excellent and will help track performance impact as the feature evolves. Overall assessment: Approve after addressing the critical items above. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request enables the force inclusion feature. The changes in pkg/config/config.go correctly re-enable the validation logic for the forced inclusion namespace, and the changes in test/e2e/evm_force_inclusion_e2e_test.go re-enable the end-to-end tests for this feature by removing t.Skip() calls. The changes are straightforward and effectively achieve the goal of activating the force inclusion functionality and its associated tests. The pull request title also mentions the addition of force inclusion benchmarks, but no new benchmark files were found in the changes; this might be planned for a subsequent pull request.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3005 +/- ##
==========================================
- Coverage 57.98% 57.97% -0.01%
==========================================
Files 110 110
Lines 10522 10523 +1
==========================================
Hits 6101 6101
- Misses 3770 3771 +1
Partials 651 651
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
ref: #2965 (comment)
ref: #2982 (comment)